<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    let obj = {
        study: 'web 前端',
        age: 15
    };
    let obj2 = obj;
    obj2.age = 20;
    console.log(obj.age);

    let num1 = 10;
    let num2 = num1;
    num2 = 20;
    console.log(num1);

    //数据
    let arr = new Array();
    arr.push('java');
    arr.push(20);
    //arr.push(obj);
    console.log(arr);
    //数组的合并
    let arr2 = ['java', 'c++'];
    let arr3=arr2.concat(arr);
    console.log(arr3);
    //数组的去重
    // let arr5=[]
    // arr3.filter(el=>{
    //     if(arr5.indexOf(el)==-1){
    //         arr5.push(el)
    //     }
    // })val,index,arr
    //filter 归来过滤，return true 才会返回到新数组中
    let arr4=arr3.filter((val,index,arr)=>{
        return val!=='java';
    })
    console.log(arr4);
    //做个了解，集合不能重复
    let set=new Set(arr3);
    console.log(set);
    //console.log(arr5);
    console.log(Object.keys(arr3))

    //values
    let arr6=[];
    arr6['keys']='kiss';
    arr6['value']='money';
    console.log(arr6)
    console.log(Object.values(arr6));

    //sort
    let arr7=[9,10,1,4,7];
    let arr8=arr7.sort();
    console.log(arr8)
    console.log(arr7)
    let arr9 = arr7.sort((a,b)=>{
       return a-b;
    })
    console.log(arr9)

    // pop
    let arr10=['java','js','python']
    let num=arr10.pop();
    console.log(num);
    console.log(arr10);

    //unshift()
    let arr11=[];
    arr11.push(1,3,5)
    console.log(arr11)
   
</script>

</html>